extends "../cex___zahuopu-Hide/item.gd"

var ItemData = preload("./itemData.gd").getCharaData()

func _init():
	._init()

func init():
	.init()
	name = ItemData.NAME
	type = config.EQUITYPE_EQUI
	attInit()
	price = 300
	info = ItemData.INFO_TEXT
	info += sys.rndListItem(adlist).format({"0":sys.rndListItem(adcolour),"1":sys.rndListItem(adprice)})

func _connect():
	if masCha.team != 1:
		yield(sys.get_tree().create_timer(0.05), "timeout")
		masCha.delItem(self)
		return 
	if  masCha.lv > 3:
		yield(sys.get_tree().create_timer(0.05), "timeout")
		masCha.delItem(self)
		return 
	if masCha.id.find("cex") >= 0 or masCha.id.find("Hide") >= 0:
		yield(sys.get_tree().create_timer(0.05), "timeout")
		masCha.delItem(self)
		return
	sys.main.player.addCha(sys.main.newChara(masCha.id))
	yield(sys.get_tree().create_timer(0.05), "timeout")
	sys.main.player.delItem(self)